package cn.gov.anhai;

import cn.gov.anhai.utils.ComputerInfo;
import org.mybatis.spring.annotation.MapperScan;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.boot.web.servlet.ServletComponentScan;
import org.springframework.context.ConfigurableApplicationContext;
import org.springframework.core.env.Environment;
import org.springframework.scheduling.annotation.EnableScheduling;

import java.io.IOException;

@SpringBootApplication
@MapperScan("cn.gov.anhai.mappers")
@ServletComponentScan
@EnableScheduling
public class AppStart {
    public static void main(String[] args) throws IOException {
        ConfigurableApplicationContext context = SpringApplication.run(AppStart.class, args);
        Environment environment = context.getBean(Environment.class);
        System.out.println("启动成功，后端服务API地址：http://" + ComputerInfo.getIpAddr() + ":"
                + environment.getProperty("server.port") + environment.getProperty("server.servlet.context-path")
                + "/doc.html");
        System.out.println("已提交git");
    }
}
